<div id="userlist">
<br/>
<hr style="color:#e6af2b"/>
<table style="">
	<th>Exam Name</th>
	<th>Duration</th>
	<th>Start Time</th>
	<th>End Time</th>
	<th class="action">Action</th>

<?php foreach( $exams as $exam ) : ?>
	<tr>
		<td><?php echo $exam['name'] ?></td>
		<td style="text-align:center;"><?php echo date('G:i', $exam['duration'] ) ?></td>
		<td style="text-align:center;"><?php echo date('D M j, Y g:ia', strtotime( $exam['start_time'] ) + 60*60*8 ) ?></td>
		<td style="text-align:center;"><?php echo date('D M j, Y g:ia', strtotime( $exam['end_time'] ) + 60*60*8 ) ?></td>
		<td style="text-align:center;"><a class="popup-exam" rel="width:800,height:600" href="/org/view/<?php echo $currentOrg ?>/exams/take-exam/<?php echo $exam['exam_id'] ?>">Take</a></td>
	</tr>
<?php endforeach;?>

</table>
<script>
$(".popup-exam").each( function (index,element ){
	$(this).click( function() {
		window.open(this.href, name, "fullscreen=1,resizable=0,width="+screen.width+",height="+screen.height);
		return false;
	} );
} );
</script>
</div>
